T
CSharpTest.Net
PropertyValue<T> Class
Members  Example  See Also  Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Reflection Namespace : PropertyValue<T> Class

Glossary Item Box

Allows setting or getting a property or field of a known type on an object via reflection

Syntax

Visual Basic (Declaration) 
Public Class PropertyValue(Of T) 
   Inherits PropertyValue
C# 
public class PropertyValue<T> : PropertyValue 

Type Parameters

T

Example

Library/Library.Test/TestPropertyValue.cs

C#Copy Code
a obj = new a();
obj.PropertyA = "a";
PropertyValue<string> pt = new PropertyValue<string>(obj, "privateField");
Assert.AreEqual("a", pt.Value);
pt.Value = "b";
Assert.AreEqual("b", pt.Value);
VB.NETCopy Code
Dim obj As New a()
obj.PropertyA = "a"
Dim pt As New PropertyValue(Of String)(obj, "privateField")
Assert.AreEqual("a", pt.Value)
pt.Value = "b"
Assert.AreEqual("b", pt.Value)

Inheritance Hierarchy

System.Object
   CSharpTest.Net.Reflection.PropertyType
      CSharpTest.Net.Reflection.PropertyValue
         CSharpTest.Net.Reflection.PropertyValue<T>

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys